
/**
 * Autor : YeQing
 */

/**
 * Page All js Object.
 */
var nav = nav || {

	/**
	 * Menu Ajax html.
	 */
	ajaxHeaderHtml : function() {
		/*var url = webServer+"/getHeaderMemuNav";
		var param = {
	        id: 123
	    };

		idealBase.doAjaxHtml(url, param, 'POST', true, function(data){
			$('#headerMenuComponent').html(data);
		});*/
	},

	/**
	 * Index page right pie chart.
	 */
	ajaxRightPieHtml : function() {
		/*var url = webServer + '/getIndexRightPie';
		var param = {};
		idealBase.doAjaxHtml(url, param, 'POST', true, function(data){
			$('#rightPieChart').html(data);
			rightPieChartInit();

			//index page.
			nav.loadLineChart();
			nav.loadPieChart();
		});*/

	},

	/**
	 * Ajax server.
	 */
	ajaxJsonData : function() {

		/*var url = webServer+"/gotoAjax";
		var param = {
	        id: 123
	    };

		idealBase.doAjaxJson(url, param, 'POST', true, function(data){

			//alert(123);

		});*/
	},


	/**
	 * load line chart.
	 */
	loadLineChart : function() {
		var lineChartData = {
				labels : ["January","February","March","April","May","June","July"],
				datasets : [
					{
						fillColor : "rgba(220,220,220,0.5)",
						strokeColor : "rgba(220,220,220,1)",
						pointColor : "rgba(220,220,220,1)",
						pointStrokeColor : "#fff",
						data : [65,59,90,81,56,55,40]
					},
					{
						fillColor : "rgba(151,187,205,0.5)",
						strokeColor : "rgba(151,187,205,1)",
						pointColor : "rgba(151,187,205,1)",
						pointStrokeColor : "#fff",
						data : [28,48,40,19,96,27,100]
					}
				]

			};

		new Chart(document.getElementById("canvas_line").getContext("2d")).Line(lineChartData);
	},

	/**
	 * load pie chart.
	 */
	loadPieChart : function() {
		var pieData = [
  			{
  				value: 30,
  				color:"#F38630"
  			},
  			{
  				value : 50,
  				color : "#E0E4CC"
  			},
  			{
  				value : 100,
  				color : "#69D2E7"
  			}

  		];

  		new Chart(document.getElementById("canvas").getContext("2d")).Pie(pieData);
	}

};

/**
 * init
 */
var init = function() {

	nav.loadPieChart();

	nav.loadLineChart();
};

$(document).ready(function() {
	init();
});